<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Redis | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../home/part1/1.常用命令.html" />
    
    
    <link rel="prev" href="../../home/NoSQL简介.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2"
        data-chapter-title="Redis"
        data-filepath="home/part1/Redis.md"
        data-basepath="../.."
        data-revision="Sun Oct 21 2018 20:49:12 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="home/NoSQL简介.html">
            
                
                    <a href="../../home/NoSQL简介.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        NoSQL介绍
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2" data-path="home/part1/Redis.html">
            
                
                    <a href="../../home/part1/Redis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        Redis
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="home/part1/1.常用命令.html">
            
                
                    <a href="../../home/part1/1.常用命令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        常用命令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="home/part1/2.Redis的数据类型.html">
            
                
                    <a href="../../home/part1/2.Redis的数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        Redis的数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="home/part1/3.Redis高级.html">
            
                
                    <a href="../../home/part1/3.Redis高级.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        Redis高级
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="home/part1/4.python操作redis.html">
            
                
                    <a href="../../home/part1/4.python操作redis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        python操作redis
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="home/part2/MongoDB.html">
            
                
                    <a href="../../home/part2/MongoDB.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        MongoDB
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="home/part2/1.MongoDB基础操作.html">
            
                
                    <a href="../../home/part2/1.MongoDB基础操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        MongoDB基础操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="home/part2/2.MongoDBDBS.html">
            
                
                    <a href="../../home/part2/2.MongoDBDBS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        MongoDB DBS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="home/part2/3.MongoDBCreate.html">
            
                
                    <a href="../../home/part2/3.MongoDBCreate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        MongoDB Create
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="home/part2/4.MongoDBUpdate.html">
            
                
                    <a href="../../home/part2/4.MongoDBUpdate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        MongoDB Update
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="home/part2/5.MongoDBDelete.html">
            
                
                    <a href="../../home/part2/5.MongoDBDelete.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        MongoDB Delete
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="home/part2/6.MongoDBRetrieve.html">
            
                
                    <a href="../../home/part2/6.MongoDBRetrieve.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        MongoDB Retrieve
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="home/part2/7.MongoDB查询条件.html">
            
                
                    <a href="../../home/part2/7.MongoDB查询条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        MongoDB 查询条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="home/part2/8.MongoDBIndex.html">
            
                
                    <a href="../../home/part2/8.MongoDBIndex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        MongoDB Index
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="home/part2/9.MongoDBDump.html">
            
                
                    <a href="../../home/part2/9.MongoDBDump.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        MongoDB Dump
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="home/part2/10.Python操作MongoDB.html">
            
                
                    <a href="../../home/part2/10.Python操作MongoDB.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        Python操作MongoDB
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="redis">Redis</h1>
<hr>
<blockquote>
<p>Redis &#x4E00;&#x4E2A;&#x5185;&#x5B58;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x901A;&#x8FC7; Key-Value &#x952E;&#x503C;&#x5BF9;&#x7684;&#x7684;&#x65B9;&#x5F0F;&#x5B58;&#x50A8;&#x6570;&#x636E;&#x3002;&#x7531;&#x4E8E; Redis &#x7684;&#x6570;&#x636E;&#x90FD;&#x5B58;&#x50A8;&#x5728;&#x5185;&#x5B58;&#x4E2D;&#xFF0C;&#x6240;&#x4EE5;&#x8BBF;&#x95EE;&#x901F;&#x5EA6;&#x975E;&#x5E38;&#x5FEB;&#xFF0C;&#x56E0;&#x6B64; Redis &#x5927;&#x91CF;&#x7528;&#x4E8E;&#x7F13;&#x5B58;&#x7CFB;&#x7EDF;&#xFF0C;&#x5B58;&#x50A8;&#x70ED;&#x70B9;&#x6570;&#x636E;&#xFF0C;&#x53EF;&#x4EE5;&#x6781;&#x5927;&#x7684;&#x63D0;&#x9AD8;&#x7F51;&#x7AD9;&#x7684;&#x54CD;&#x5E94;&#x901F;&#x5EA6;&#x3002;</p>
</blockquote>
<p><img src="../images/redis.png" alt=""></p>
<h2 id="&#x4F18;&#x70B9;">&#x4F18;&#x70B9;</h2>
<ul>
<li><p>&#x652F;&#x6301;&#x6570;&#x636E;&#x7684;&#x6301;&#x4E45;&#x5316;&#xFF0C;&#x901A;&#x8FC7;&#x914D;&#x7F6E;&#x53EF;&#x4EE5;&#x5C06;&#x5185;&#x5B58;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x4FDD;&#x5B58;&#x5728;&#x78C1;&#x76D8;&#x4E2D;&#xFF0C;Redis &#x91CD;&#x542F;&#x4EE5;&#x540E;&#x518D;&#x5C06;&#x6570;&#x636E;&#x52A0;&#x8F7D;&#x5230;&#x5185;&#x5B58;&#x4E2D;&#xFF1B;</p>
</li>
<li><p>&#x652F;&#x6301;&#x5217;&#x8868;&#xFF0C;&#x54C8;&#x5E0C;&#xFF0C;&#x6709;&#x5E8F;&#x96C6;&#x5408;&#x7B49;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x6781;&#x5927;&#x7684;&#x6269;&#x5C55;&#x4E86; Redis &#x7528;&#x9014;&#xFF1B;</p>
</li>
<li><p>&#x539F;&#x5B50;&#x64CD;&#x4F5C;&#xFF0C;Redis &#x7684;&#x6240;&#x6709;&#x64CD;&#x4F5C;&#x90FD;&#x662F;&#x539F;&#x5B50;&#x6027;&#x7684;&#xFF0C;&#x8FD9;&#x4F7F;&#x5F97;&#x57FA;&#x4E8E; Redis &#x5B9E;&#x73B0;&#x5206;&#x5E03;&#x5F0F;&#x9501;&#x975E;&#x5E38;&#x7B80;&#x5355;&#xFF1B;</p>
</li>
<li><p>&#x652F;&#x6301;&#x53D1;&#x5E03;/&#x8BA2;&#x9605;&#x529F;&#x80FD;&#xFF0C;&#x6570;&#x636E;&#x8FC7;&#x671F;&#x529F;&#x80FD;&#xFF1B;</p>
</li>
</ul>
<h4 id="&#x73AF;&#x5883;&#x51C6;&#x5907;">&#x73AF;&#x5883;&#x51C6;&#x5907;</h4>
<blockquote>
<p><a href="http://www.runoob.com/redis/redis-install.html" target="_blank">http://www.runoob.com/redis/redis-install.html</a></p>
</blockquote>
<h2 id="ubuntu-&#x4E0B;&#x5B89;&#x88C5;">Ubuntu &#x4E0B;&#x5B89;&#x88C5;</h2>
<p>&#x5728; Ubuntu &#x7CFB;&#x7EDF;&#x5B89;&#x88C5; Redi &#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;:</p>
<pre><code class="lang-bash"><span class="hljs-variable">$sudo</span> apt-get update
<span class="hljs-variable">$sudo</span> apt-get install redis-server
</code></pre>
<h2 id="ubuntu-&#x4E0B;&#x5B89;&#x88C5;">Ubuntu &#x4E0B;&#x5B89;&#x88C5;</h2>
<pre><code class="lang-bash"><span class="hljs-variable">$sudo</span> apt-get update
<span class="hljs-variable">$sudo</span> apt-get install redis-server
</code></pre>
<h2 id="&#x542F;&#x52A8;-redis">&#x542F;&#x52A8; Redis</h2>
<pre><code class="lang-bash">$ redis-server
</code></pre>
<h2 id="&#x67E5;&#x770B;-redis-&#x662F;&#x5426;&#x542F;&#x52A8;">&#x67E5;&#x770B; redis &#x662F;&#x5426;&#x542F;&#x52A8;</h2>
<pre><code class="lang-bash">$ redis-cli
</code></pre>
<h5 id="&#x4EE5;&#x4E0A;&#x547D;&#x4EE4;&#x5C06;&#x6253;&#x5F00;&#x4EE5;&#x4E0B;&#x7EC8;&#x7AEF;&#xFF1A;">&#x4EE5;&#x4E0A;&#x547D;&#x4EE4;&#x5C06;&#x6253;&#x5F00;&#x4EE5;&#x4E0B;&#x7EC8;&#x7AEF;&#xFF1A;</h5>
<pre><code class="lang-sql">redis 127.0.0.1:6379&gt;
</code></pre>
<p>127.0.0.1 &#x662F;&#x672C;&#x673A; IP &#xFF0C;6379 &#x662F; redis &#x670D;&#x52A1;&#x7AEF;&#x53E3;&#x3002;&#x73B0;&#x5728;&#x6211;&#x4EEC;&#x8F93;&#x5165; PING &#x547D;&#x4EE4;&#x3002;</p>
<pre><code class="lang-sql">redis 127.0.0.1:6379&gt; ping
PONG
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x8BF4;&#x660E;&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x6210;&#x529F;&#x5B89;&#x88C5;&#x4E86;redis&#x3002;</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../home/NoSQL简介.html" class="navigation navigation-prev " aria-label="Previous page: NoSQL介绍"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../home/part1/1.常用命令.html" class="navigation navigation-next " aria-label="Next page: 常用命令"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
